package com.yang.concurrency.chapter2;

/**
 * @Author: 血魔
 * @Date: Created in 13:06 2021/12/12
 * @Version: 1.0$
 */
public class TaxCalculatorMain {
    public static void main(String[] args) {
        /*TaxCalaculator taxCalaculator = new TaxCalaculator(10000d, 20000d){
            public double calcTax(){
                return getSalary() * 0.1 + getBonus() * 0.15;
            }
        };
        double tax = taxCalaculator.calculate();
        System.out.println(tax);*/

        TaxCalaculator calculator = new TaxCalaculator(10000d, 20000d);
        SimpleCalculatorStrategy scs = new SimpleCalculatorStrategy();
        calculator.setCalculatorStrategy(scs);
        calculator.setCalculatorStrategy((s,b) -> s*0.1 + b*1.1);
        double calculate = calculator.calculate();
        System.out.println(calculate);

    }
}
